@extends('layouts.app')

@section('content')
<div class="container">
   @foreach($posts as $post)
   <div class="row">
        <div class="col-6 offset-3">
            <a href="/profile/{{ $post->user->id }}">
                <img src="/storage/{{ $post->image }}" alt="" class="w-100">
            </a>
        </div>
    
    <div class="row pb-5">
        <div class="col-8 offset-2">
            <div>
                <p>
                    <span>
                        <b>
                            <a class="text-decoration-none" href="/profile/{{ $post->user->id }}">
                                <span class="text-dark">{{ $post->user->username }}</span>
                            </a>
                        </b>
                    </span>     {{ $post->caption }}
                </p>
            </div>
        </div>
    </div>
    @endforeach

    <div class="d-flex">
        <div class="col-12 d-flex justify-content-center">
            {{ $posts->links() }}
        </div>
    </div>
</div>
@endsection